From 5d4beaecb5851bbee2a73b381ab6f4be446d459a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann?= Date: Tue, 16 May 2006 16:51:27 +0000 Subject: [PATCH] Move getting the property out of the loop, and rename the variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Tue May 16 12:36:25 2006 Søren Sandmann * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the property out of the loop, and rename the variable 'max_expand'. * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription for the max-child-expand property. --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ gtk/gtktoolbar.c | 12 +++++++----- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e37e15003..9724726fa9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Tue May 16 12:36:25 2006 Søren Sandmann + + * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the + property out of the loop, and rename the variable 'max_expand'. + + * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription + for the max-child-expand property. + 2006-05-16 Matthias Clasen * gtk/gtkprinter.c (gtk_printer_class_init): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4e37e15003..9724726fa9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Tue May 16 12:36:25 2006 Søren Sandmann + + * gtk/gtktoolbar.c (gtk_toolbar_size_allocate): Move getting the + property out of the loop, and rename the variable 'max_expand'. + + * gtk/gtktoolbar.c (gtk_toolbar_class_init): Fix the decription + for the max-child-expand property. + 2006-05-16 Matthias Clasen * gtk/gtkprinter.c (gtk_printer_class_init): diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 7f384d9828..6606617611 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -595,8 +595,8 @@ gtk_toolbar_class_init (GtkToolbarClass *klass) gtk_widget_class_install_style_property (widget_class, g_param_spec_int ("max-child-expand", - P_("Maximum toolbar item spacing"), - P_("Maximum space between the toolbar items."), + P_("Maximum child expand"), + P_("Maximum amount of space an expandable item will be given"), 0, G_MAXINT, G_MAXINT, @@ -1591,7 +1591,9 @@ gtk_toolbar_size_allocate (GtkWidget *widget, */ if (!overflowing) { + gint max_child_expand; n_expand_items = 0; + for (i = 0, list = priv->content; list != NULL; list = list->next, ++i) { ToolbarContent *content = list->data; @@ -1600,19 +1602,19 @@ gtk_toolbar_size_allocate (GtkWidget *widget, n_expand_items++; } + max_child_expand = get_max_child_expand (toolbar); for (list = priv->content, i = 0; list != NULL; list = list->next, ++i) { ToolbarContent *content = list->data; if (toolbar_content_get_expand (content) && new_states[i] == NORMAL) { - gint mexpand = get_max_child_expand (toolbar); gint extra = size / n_expand_items; if (size % n_expand_items != 0) extra++; - if (extra > mexpand) - extra = mexpand; + if (extra > max_child_expand) + extra = max_child_expand; allocations[i].width += extra; size -= extra; -- 2.30.2